package vn.buffalocoders.rikos.ui.common;

import java.util.ArrayList;

import com.facebook.SessionDefaultAudience;
import com.sromku.simple.fb.Permissions;
import com.sromku.simple.fb.SimpleFacebook;
import com.sromku.simple.fb.SimpleFacebookConfiguration;
import com.sromku.simple.fb.utils.Logger;

import android.app.Application;

public class FacebookApplication extends Application {
	private static final String APP_ID = "251712631650093";
	private static final String APP_NAMESPACE = "rikostest";
	private SimpleFacebook mSimpleFacebook;
	private ArrayList<RikoBook> listbook = null;
	
	@Override
	public void onCreate()
	{
		super.onCreate();
		
		// set log to true
		Logger.DEBUG_WITH_STACKTRACE = true;

		// initialize facebook configuration
		Permissions[] permissions = new Permissions[]
		{
			Permissions.BASIC_INFO,
			Permissions.EMAIL,
			Permissions.USER_PHOTOS,
			Permissions.USER_BIRTHDAY,
			Permissions.PUBLISH_ACTION,
			Permissions.PUBLISH_STREAM,
			Permissions.READ_FRIENDLISTS,
		};

		SimpleFacebookConfiguration configuration = new SimpleFacebookConfiguration.Builder()
			.setAppId(APP_ID)
			.setNamespace(APP_NAMESPACE)
			.setPermissions(permissions)
			.setDefaultAudience(SessionDefaultAudience.FRIENDS)
			.build();

		SimpleFacebook.setConfiguration(configuration);
	}
	
	public SimpleFacebook getSimpleFacebook()
	{
		return mSimpleFacebook;
	}
	
	public void setSimpleFacebook(SimpleFacebook _simpleFacebook)
	{
		mSimpleFacebook = _simpleFacebook;
	}
	
	public ArrayList<RikoBook> getListBook()
	{
		return listbook;
	}
	
	public void setListBook(ArrayList<RikoBook> listBook)
	{
		listbook = listBook;
	}
}
